
//
//  NewsHeaderView.m
//  xpkc
//
//  Created by 胡志飞 on 15/11/4.
//  Copyright © 2015年 TopSage. All rights reserved.
//

#import "NewsHeaderView.h"

@implementation NewsHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
       
        self.titleLabel = [[UILabel alloc]init];
        self.titleLabel.backgroundColor = [UIColor whiteColor];
        [self addSubview:self.titleLabel];
        
        self.markView = [[UIView alloc]init];
        self.markView.backgroundColor = GreenColor;
        [self addSubview:self.markView];
        
        self.moreBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:self.moreBtn];
    }

    return self;
}



- (void)layoutSubviews {
    [super layoutSubviews];
    
    
    CGFloat markViewW = 5;
    CGFloat markViewH = 15;
    CGFloat markViewX = 12;
    self.markView.frame = CGRectMake(markViewX, 0.5 * (self.frame.size.height-markViewH), markViewW, markViewH);
    self.titleLabel.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
    self.moreBtn.frame = CGRectMake(self.frame.size.width-60, (self.frame.size.height-20)/2, 45, 20);
    [self.moreBtn setTitle:@"More >" forState:UIControlStateNormal];
    [self.moreBtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    self.moreBtn.titleLabel.font = [UIFont systemFontOfSize:12];
}

@end
